<?php
if ($author->second_name_first == 1) {
    echo $author->second_name . ' ' . $author->first_name . '<br />';
} else {
    echo $author->first_name . ' ' . $author->second_name . '<br />';
}
?>